#!/usr/bin/env python
# *-utf8-*


"""
Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0,
where each _ is a single digit.
"""

# 2010-06-03

def conform_to_form(num):
    square = num * num
    if len(str(square)) == 19 and str(square)[0] == '1' and str(square)[2] == '2' and str(square)[4] == '3' and str(square)[6] == '4' and str(square)[8] == '5' and str(square)[10] == '6' and str(square)[12] == '7' and str(square)[14] == '8' and str(square)[16] == '9' and  str(square)[18] == '0':
        return True
    
    return False

if __name__ == "__main__":
    num = 1389026623
    while not conform_to_form(num):
        num = num - 1
    
    print num
